package com.xcjh.opencv.rule.youlian;

import com.xcjh.opencv.ExeRule;
import com.xcjh.opencv.FindSimilarImage;
import com.xcjh.opencv.emuns.MatchImage;
import com.xcjh.opencv.rule.BaseRule;
import org.springframework.stereotype.Component;

import java.awt.*;

@Component
public class Youlian implements BaseRule {
    @Override
    public String getRuleName() {
        return "有恋";
    }

    @Override
    public void run(Robot robot) throws Exception {
        sendMsg(robot);
    }

    private void sendMsg(Robot robot) throws Exception {


        findAndClickPic(MatchImage.有缘打招呼, robot);
        ExeRule.delayByRobot(1000,robot);
        findAndClickPic(MatchImage.有缘交换微信, robot);
        findAndClickPic(MatchImage.有缘现在交换, robot);
        ExeRule.delayByRobot(1000,robot);
        ExeRule.leftClickByRobot(1,robot);
        ExeRule.delayByRobot(100,robot);
        findAndClickPic(MatchImage.有缘我知道, robot);
        ExeRule.delayByRobot(100,robot);
        findAndClickPic(MatchImage.有缘私信, robot);
        //发消息1
        System.out.println("开始执行");
        exeRule(robot, "youlian/有恋.txt");
        System.out.println("执行结束");
        FindSimilarImage.go=false;
    }
}
